Optimal. Leaf size=127 \[ (a-b)^{3/2} \text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\frac {\left (3 a^2-12 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{8 \sqrt {b}}-\frac {1}{8} (5 a-4 b) \cot (x) \sqrt {a+b \cot ^2(x)}-\frac {1}{4} b \cot ^3(x) \sqrt {a+b \cot ^2(x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 8, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.471, Rules used = {3751, 488, 596,
537, 223, 212, 385, 209} \begin {gather*} -\frac {\left (3 a^2-12 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{8 \sqrt {b}}+(a-b)^{3/2} \text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\frac {1}{8} (5 a-4 b) \cot (x) \sqrt {a+b \cot ^2(x)}-\frac {1}{4} b \cot ^3(x) \sqrt {a+b \cot ^2(x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 212
Rule 223
Rule 385
Rule 488
Rule 537
Rule 596
Rule 3751
Rubi steps
\begin {align*} \int \cot ^2(x) \left (a+b \cot ^2(x)\right )^{3/2} \, dx &=-\text {Subst}\left (\int \frac {x^2 \left (a+b x^2\right )^{3/2}}{1+x^2} \, dx,x,\cot (x)\right )\\ &=-\frac {1}{4} b \cot ^3(x) \sqrt {a+b \cot ^2(x)}-\frac {1}{4} \text {Subst}\left (\int \frac {x^2 \left (a (4 a-3 b)+(5 a-4 b) b x^2\right )}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\frac {1}{8} (5 a-4 b) \cot (x) \sqrt {a+b \cot ^2(x)}-\frac {1}{4} b \cot ^3(x) \sqrt {a+b \cot ^2(x)}+\frac {\text {Subst}\left (\int \frac {a (5 a-4 b) b-b \left (3 a^2-12 a b+8 b^2\right ) x^2}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )}{8 b}\\ &=-\frac {1}{8} (5 a-4 b) \cot (x) \sqrt {a+b \cot ^2(x)}-\frac {1}{4} b \cot ^3(x) \sqrt {a+b \cot ^2(x)}+(a-b)^2 \text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )+\frac {1}{8} \left (-3 a^2+12 a b-8 b^2\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\frac {1}{8} (5 a-4 b) \cot (x) \sqrt {a+b \cot ^2(x)}-\frac {1}{4} b \cot ^3(x) \sqrt {a+b \cot ^2(x)}+(a-b)^2 \text {Subst}\left (\int \frac {1}{1-(-a+b) x^2} \, dx,x,\frac {\cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+\frac {1}{8} \left (-3 a^2+12 a b-8 b^2\right ) \text {Subst}\left (\int \frac {1}{1-b x^2} \, dx,x,\frac {\cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )\\ &=(a-b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\frac {\left (3 a^2-12 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{8 \sqrt {b}}-\frac {1}{8} (5 a-4 b) \cot (x) \sqrt {a+b \cot ^2(x)}-\frac {1}{4} b \cot ^3(x) \sqrt {a+b \cot ^2(x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.29, size = 253, normalized size = 1.99 \begin {gather*} \frac {\sqrt {-a-b+(a-b) \cos (2 x)} \csc (x) \left (8 \sqrt {2} (a-b)^2 \sqrt {-b} \tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {a-b} \cos (x)}{\sqrt {-a-b+(a-b) \cos (2 x)}}\right )+\sqrt {a-b} \left (-\sqrt {2} \left (3 a^2-12 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {-b} \cos (x)}{\sqrt {-a-b+(a-b) \cos (2 x)}}\right )+\sqrt {-b} \sqrt {-a-b+(a-b) \cos (2 x)} \cot (x) \csc (x) \left (5 a-6 b+2 b \csc ^2(x)\right )\right )\right )}{8 \sqrt {2} \sqrt {a-b} \sqrt {-b} \sqrt {-\left ((-a-b+(a-b) \cos (2 x)) \csc ^2(x)\right )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(322\) vs.
\(2(105)=210\).
time = 0.12, size = 323, normalized size = 2.54
method | result | size |
derivativedivides | \(-\frac {\cot \left (x \right ) \left (a +b \left (\cot ^{2}\left (x \right )\right )\right )^{\frac {3}{2}}}{4}-\frac {3 a \left (\frac {\cot \left (x \right ) \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}{2}+\frac {a \ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{2 \sqrt {b}}\right )}{4}+b^{2} \left (\frac {\cot \left (x \right ) \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}{2 b}-\frac {a \ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{2 b^{\frac {3}{2}}}-\frac {\ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{\sqrt {b}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{b^{2} \left (a -b \right )}\right )+2 a b \left (\frac {\ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{\sqrt {b}}-\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{b^{2} \left (a -b \right )}\right )+\frac {a^{2} \sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{b^{2} \left (a -b \right )}\) | \(323\) |
default | \(-\frac {\cot \left (x \right ) \left (a +b \left (\cot ^{2}\left (x \right )\right )\right )^{\frac {3}{2}}}{4}-\frac {3 a \left (\frac {\cot \left (x \right ) \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}{2}+\frac {a \ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{2 \sqrt {b}}\right )}{4}+b^{2} \left (\frac {\cot \left (x \right ) \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}{2 b}-\frac {a \ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{2 b^{\frac {3}{2}}}-\frac {\ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{\sqrt {b}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{b^{2} \left (a -b \right )}\right )+2 a b \left (\frac {\ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}\right )}{\sqrt {b}}-\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{b^{2} \left (a -b \right )}\right )+\frac {a^{2} \sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{b^{2} \left (a -b \right )}\) | \(323\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 279 vs.
\(2 (105) = 210\).
time = 3.43, size = 1134, normalized size = 8.93 \begin {gather*} \left [\frac {8 \, {\left (a b - b^{2} - {\left (a b - b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {-a + b} \log \left (-{\left (a - b\right )} \cos \left (2 \, x\right ) + \sqrt {-a + b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + b\right ) \sin \left (2 \, x\right ) - {\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2} - {\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {b} \log \left (\frac {{\left (a - 2 \, b\right )} \cos \left (2 \, x\right ) + 2 \, \sqrt {b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) - a - 2 \, b}{\cos \left (2 \, x\right ) - 1}\right ) \sin \left (2 \, x\right ) + 2 \, {\left (4 \, b^{2} \cos \left (2 \, x\right ) - {\left (5 \, a b - 6 \, b^{2}\right )} \cos \left (2 \, x\right )^{2} + 5 \, a b - 2 \, b^{2}\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}}}{16 \, {\left (b \cos \left (2 \, x\right ) - b\right )} \sin \left (2 \, x\right )}, -\frac {{\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2} - {\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {-b} \arctan \left (\frac {\sqrt {-b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{b \cos \left (2 \, x\right ) + b}\right ) \sin \left (2 \, x\right ) - 4 \, {\left (a b - b^{2} - {\left (a b - b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {-a + b} \log \left (-{\left (a - b\right )} \cos \left (2 \, x\right ) + \sqrt {-a + b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + b\right ) \sin \left (2 \, x\right ) - {\left (4 \, b^{2} \cos \left (2 \, x\right ) - {\left (5 \, a b - 6 \, b^{2}\right )} \cos \left (2 \, x\right )^{2} + 5 \, a b - 2 \, b^{2}\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}}}{8 \, {\left (b \cos \left (2 \, x\right ) - b\right )} \sin \left (2 \, x\right )}, -\frac {16 \, {\left (a b - b^{2} - {\left (a b - b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {a - b} \arctan \left (-\frac {\sqrt {a - b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) + a - b}\right ) \sin \left (2 \, x\right ) + {\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2} - {\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {b} \log \left (\frac {{\left (a - 2 \, b\right )} \cos \left (2 \, x\right ) + 2 \, \sqrt {b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) - a - 2 \, b}{\cos \left (2 \, x\right ) - 1}\right ) \sin \left (2 \, x\right ) - 2 \, {\left (4 \, b^{2} \cos \left (2 \, x\right ) - {\left (5 \, a b - 6 \, b^{2}\right )} \cos \left (2 \, x\right )^{2} + 5 \, a b - 2 \, b^{2}\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}}}{16 \, {\left (b \cos \left (2 \, x\right ) - b\right )} \sin \left (2 \, x\right )}, -\frac {8 \, {\left (a b - b^{2} - {\left (a b - b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {a - b} \arctan \left (-\frac {\sqrt {a - b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) + a - b}\right ) \sin \left (2 \, x\right ) + {\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2} - {\left (3 \, a^{2} - 12 \, a b + 8 \, b^{2}\right )} \cos \left (2 \, x\right )\right )} \sqrt {-b} \arctan \left (\frac {\sqrt {-b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{b \cos \left (2 \, x\right ) + b}\right ) \sin \left (2 \, x\right ) - {\left (4 \, b^{2} \cos \left (2 \, x\right ) - {\left (5 \, a b - 6 \, b^{2}\right )} \cos \left (2 \, x\right )^{2} + 5 \, a b - 2 \, b^{2}\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}}}{8 \, {\left (b \cos \left (2 \, x\right ) - b\right )} \sin \left (2 \, x\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \cot ^{2}{\left (x \right )}\right )^{\frac {3}{2}} \cot ^{2}{\left (x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {cot}\left (x\right )}^2\,{\left (b\,{\mathrm {cot}\left (x\right )}^2+a\right )}^{3/2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________